<?php
namespace app\home\controller;

use app\home\model\BfNewslanmu;
use app\home\model\BfNewslist;
use app\home\model\BfAd;

class Newslanmu extends BaseController{
    
    public function initialize(){
        $this -> _G['webseo'] = $this -> getSEOinfo();
        $this -> _G['webinfo'] = $this -> getWebinfo();
        
        $this -> assign('_G',$this -> _G);
    }
    
    public function index(){
        $get = $this -> request -> param();
        $lanmu = BfNewslanmu :: where(['id' => $get['id']]) -> find();
        $sublanmulist = BfNewslanmu :: where(['topid' => $get['id']]) -> select();
        
        $this -> assign('lanmu', $lanmu);
        $this -> assign('sublanmulist', $sublanmulist);
        $lanmu['contentarr'] = explode('_ueditor_page_break_tag_',$lanmu['content']);
        
        $newslist = BfNewslist :: where(['lanmuid' => $lanmu['id']]) -> select();
        /*$list = [
            [
                'name' => '5000',
                'shiqing' => 'test',
                'img_url' => '/static/admin/img/addLogo_box.png'
            ],
            [
                'name' => '5000',
                'shiqing' => 'test',
                'img_url' => '/static/admin/img/addLogo_box.png'
            ],
            [
                'name' => '5000',
                'shiqing' => 'test',
                'img_url' => '/static/admin/img/addLogo_box.png'
            ],
            [
                'name' => '5000',
                'shiqing' => 'test',
                'img_url' => '/static/admin/img/addLogo_box.png'
            ],
            [
                'name' => '5000',
                'shiqing' => 'test',
                'img_url' => '/static/admin/img/addLogo_box.png'
            ],
            [
                'name' => '5000',
                'shiqing' => 'test',
                'img_url' => '/static/admin/img/addLogo_box.png'
            ]
        ];*/
        $this -> assign('newslist', $newslist);
        return $this -> fetch($lanmu['lietemp']);
    }
}